package com.cuit.bysj.dao;

import java.util.List;

import com.cuit.bysj.entities.Appraise;
import com.cuit.bysj.entities.Select;
import com.cuit.bysj.entities.State;
import com.cuit.bysj.entities.User;

public class AppraiseTcherDao extends BaseDao {

	// 查询要评价的教师列表
	@SuppressWarnings("rawtypes")
	public List loadlist(String hql) {

		List list = getSession().createQuery(hql).list();

		return list;
	}

	public void addTable(Appraise a) {
		getSession().save(a);
	}

	// 查询单个实体对象
	public User getByID(Integer id) {
		return (User) getSession().get(User.class, id);
	}

	// 查询单个实体对象
	public Appraise getAppraise(Integer id) {
		return (Appraise) getSession().get(Appraise.class, id);
	}

	// 查询某张评价表对象
	public Appraise getAppraiseByID(Integer Appraiseid) {
		return (Appraise) getSession().get(Appraise.class, Appraiseid);
	}

	// 查询评教开启状态
	public State queryState(Integer id) {
		return (State) getSession().get(State.class, id);
	}

	public void addSelect(Select s) {
		getSession().save(s);
	}
	
	public void updateform(Appraise a){
		getSession().update(a);
	}
}
